package com.da.lon.wang.xlg.activity;

import android.net.Uri;
import android.os.Bundle;

import com.da.lon.wang.xlg.R;
import com.da.lon.wang.xlg.util.Utils;
import com.umeng.analytics.MobclickAgent;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

/**
 * 通过网页链接打开app
 *
 * @author chencong
 */
public class TransitWebOpendAppActivity extends BaseActivity {

    private TransitWebOpendAppActivity context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ouka_address);
        context = this;
        try {
            Uri uri = getIntent().getData();
            String url = uri.getQueryParameter("url");
            url = URLDecoder.decode(url, "UTF-8");
            Utils.onClickBannerStartActivity(context, 1, url);
            finish();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }

}
